<?php
include 'config.php';
logWrite(THIS_PAGE);
$sql = trim($_REQUEST['sql']);
if ($sql){
    $sql = str_replace('\\\\\\', '\\', $sql);
    $sql = str_replace("\\'", "'", $sql);
    if($db->query($sql)){
        $rs = 1;        
    }else {
        $rs = 0;
    }
}else {
    $rs = -1;
}
echo $rs;
logWrite($sql);